package com.ithinkstudio.jeez;

import com.ithinkstudio.jeez.generator.GenerateService;
import com.ithinkstudio.jeez.generator.config.GenerateConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.Resource;

/**
 * 启动类
 * @author felix
 */
@SpringBootApplication
@Slf4j
public class CodeGeneratorApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(CodeGeneratorApplication.class, args);
    }

    @Resource
    private GenerateConfig generateConfig;
    @Resource
    private GenerateService generateService;

    /**
     * Callback used to run the bean.
     *
     * @param args incoming main method arguments
     * @throws Exception on error
     */
    @Override
    public void run(String... args) throws Exception {
        System.out.println(generateConfig);
        generateService.generate();
    }


}
